Type.registerNamespace('bitworksWeb.slideShow');
bitworksWeb.slideShow=function(imagenes,combo,idDivImagenes,idImagenInterna,idLink,tiempoTrans,nombreVar){
    this._imagenes=imagenes;
    this._currImg=0;
    this._interId=0;
    this._tiempo=tiempoTrans;
    this._combo=combo;
    this._idDiv=idDivImagenes;
    this._idImg=idImagenInterna;
    this._nombreVar=nombreVar;
    this._idLink=idLink;
    
    var opt;
    var i;
    for(i=0;i<=this._imagenes.length -1;i++){
    opt=document.createElement("OPTION");
    opt.text = this._imagenes[i].textoCombo;
    if (i==0)
        opt.selected=1;
    opt.value = i;
    this._combo.options.add(opt);}
}
bitworksWeb.slideShow.prototype={
iniciar: function(){
$get(this._idDiv).style.backgroundImage = "url(" + this._imagenes[this._currImg].src + ")"; 
$get(this._idImg).src = this._imagenes[this._currImg].src;
this._interId=setInterval(this._nombreVar + '.rotacionImg()',this._tiempo);

},
rotacionImg: function(){
if (this._currImg  >= this._imagenes.length -1)
    this._currImg=0;
else
    this._currImg++;
var i;
if ($get(this._idLink)!=null)
    $get(this._idLink).href=this._imagenes[this._currImg].url;
 this._combo.options[this._currImg].selected=1;
 cambioImagenes(this._idDiv,this._idImg,this._imagenes[this._currImg].src,500);
 },
cambioCombo: function(){
this._currImg=$get('ddlBanners').selectedIndex;
clearInterval(this._interId);
if ($get(this._idLink)!=null)
    $get(this._idLink).href=this._imagenes[this._currImg].url;
cambioImagenes(this._idDiv,this._idImg,this._imagenes[this._currImg].src,500);
},
atras: function() {
this._currImg=this._currImg-1
if (this._currImg < 0)
    this._currImg=0;
    clearInterval(this._interId);
if ($get(this._idLink)!=null)
    $get(this._idLink).href=this._imagenes[this._currImg].url;
  this._combo.options[this._currImg].selected=1;
cambioImagenes(this._idDiv,this._idImg,this._imagenes[this._currImg].src,500);
},
adelante: function() {
this._currImg=this._currImg+1;
if (this._currImg>this._imagenes.length-1)
    this._currImg = this._imagenes.length-1;
clearInterval(this._interId);
if ($get(this._idLink)!=null)
    $get(this._idLink).href=this._imagenes[this._currImg].url;
 this._combo.options[this._currImg].selected=1;
cambioImagenes(this._idDiv,this._idImg,this._imagenes[this._currImg].src,500);
},
detener: function(){

clearInterval(this._interId);
},
getCurrImg: function(){
return this._currImg;
},
getImagenes: function(){
return this._imagenes;
}
}
bitworksWeb.slideShow.registerClass('bitworksWeb.slideShow');


Type.registerNamespace('bitworksWeb.elementoSS');
bitworksWeb.elementoSS=function (_src,_alt,_url,_textoCombo){
this.src=_src;
this.alt=_alt;
this.url=_url;
this.textoCombo=_textoCombo;
}

bitworksWeb.elementoSS.registerClass('bitworksWeb.elementoSS');